package cn.hp.service.impl;

import cn.hp.entity.Role2;
import cn.hp.mapper.Role2Mapper;
import cn.hp.service.Role2Service;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
@Service
public class Role2ServiceImpl implements Role2Service {
    @Resource
    private Role2Mapper roleMapper2;

    @Override
    public PageInfo<Role2> findRole(Role2 role, Integer page, Integer limit) {
        PageHelper.startPage(page,limit);
        List<Role2> list = roleMapper2.findRole(role);
        return new PageInfo<>(list);
    }

    @Override
    public List<Role2> findRole(Role2 role) {
        return roleMapper2.findRole(role);
    }

    @Override
    public int insertRole(Role2 role) {
        return roleMapper2.insertRole(role);
    }

    @Override
    public int updateRole(Role2 role) {
        return roleMapper2.updateRole(role);
    }

    @Override
    public int deleteRoleById(Integer id) {
        return roleMapper2.deleteRoleById(id);
    }
}
